﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GDF_kaart_inlezen.strategy_classes
{
    class SegmentAtrribute : ReadingStrategy
    {
        public SegmentAtrribute()
        {
            recordCode = "44";
        }

        public override void Process(string record)
        {
            counter = 0;
            String fieldValue;

            if (record.Substring(0, 2) == recordCode) record = record.Substring(2);
            fieldValue = GetFieldValue("SATT_ID", ref record);
            //Implement processing
            fieldValue = GetFieldValue("FROM", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("TO", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("ABS_REL", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("ATT_DIR", ref record);
            //Implement processing
            fieldValue = GetFieldValue("NUM_ATT", ref record);
            int num_att = Int32.Parse(fieldValue);
            for (int i = 0; i < num_att; i++)
            {
                fieldValue = GetFieldValue("ATT_TYPE", ref record);
                //Implement processing
                fieldValue = GetFieldValue("DESC_ID", ref record);
                //ALWAYS BLANK, so no processing needed
                fieldValue = GetFieldValue("ATT_VALUE", ref record);
                //Implement processing
            }
        }
    }
}
